package com.laizhenghua.share.rule.api;

import com.laizhenghua.share.common.core.constant.ServiceNameConstants;
import com.laizhenghua.share.common.core.domain.R;
import com.laizhenghua.share.rule.api.domain.entity.FeeRule;
import com.laizhenghua.share.rule.api.factory.RemoteRuleServiceFallbackFactory;
import io.swagger.v3.oas.annotations.Operation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * TODO
 *
 * @Description
 * @Author laizh
 * @Date 2025/10/15 21:44
 **/
@FeignClient(contextId = "remoteRuleService", value = ServiceNameConstants.RULE_SERVICE, fallbackFactory = RemoteRuleServiceFallbackFactory.class)
public interface RemoteRuleService {
    @PostMapping("/fee-rule/list")
    @Operation(summary = "批量获取费用规则信息")
    R<List<FeeRule>> list(@RequestBody List<Long> ids);

    @GetMapping("/fee-rule/detail/{id}")
    @Operation(summary = "获取费用规则详情")
    R<FeeRule> detail(@PathVariable("id") Long id);
}
